Random URL is a CGI for WebSTAR or MacHTTP (or any other CGI sdoc compatible web server) which randomly returns an url, from a text file, to clients. This program is shareware - see below for details.
Instructions
Put the CGI where you want it in your http folder hierarchy. The CGI is sufficiently fast at returning results that you're best to leave it as a CGI instead of an ACGI.
You need to create a text file containing the urls to be randomly chosen from. It MUST be a plain return delimited list (Macintosh format carriage returns, not UNIX linefeeds or dos crlf pairs). Do not put any spaces before or after the urls. Do not put in any blank lines. You may have one terminating return (carriage return) at the end of the file, but it is not required.
When the text file has been created, put it in the same folder as the Random URL CGI and give it the same name as the cgi with ".rnd" appended to the end of the name. So, if the cgi is named "random.cgi" the text file should be named "random.cgi.rnd". A sample file that has already been indexed (but can be re-indexed if you want to try this out) is included with the Random URL CGI.
You will want to pre-index the text file. This is done by dragging the file onto the icon of the "random.cgi" application. Important: any time you change the text file you must re-index it by dragging it onto the application icon.
Limitations
File Size: 32767 bytes maximum size. Anything larger will not be used.
URL Size: 4095 characters maximum.
Total URLs: 32767. But then, you can't fit that many into a 32767 byte file anyway.
This is beta software but it seems to actually work without problems! Don't bet your life on it though...
Application errors currently aren't reported. There is also no user feedback to indicate success/failure of indexing an url list text file. These will be fixed in a future version.
I've set up a mailing list for discussing the framework on which this CGI is based. It is intended to be a forum for information, ideas, questions and announcements about CGIs written by me, and about writing CGIs using Grant's CGI Framework.
Send a message with the command "subscribe" as the subject to:
The aditional code specific to this project is not available.
Legal Stuff:
See the "License and Limited Warranty" document for all the boring details.
Shareware
If you like this software and decide to continue to use it for more than 28 days, you must purchase a license the author. Each license entitles you to run as many copies of the software as you want on a single machine. Additional machines require additional licenses.
* Commercial users: US$15 (Canadians pay CDN$15 no GST)
* Non-profit users: US$5 (Canadians pay CDN$5 no GST)
* Site License: US$50 (Canadians pay CDN$50 no GST)
* World-wide Site License: US$275 (Canadians pay CDN$275 no GST)
Add $1 if you want a paper receipt.
Please send Cash, cheque or money order payable to:
Grant Neufeld
907, 210 Gloucester Street
Ottawa, Ontario
K2P 2K4 CANADA
Include your name, company, mailing address (optional), and e-mail address. Registered users with e-mail addresses will receive advance updates. All registered users will be entitled to free upgrades through the life of this product.
I plan to sign up with a shareware payment service for credit card users - watch for details.
Possible Future Enhancements
The following are things I would like to do to improve this CGI. Note that the more I receive in shareware fees, the more features will be implemented.
* Multiple files for randomization choice
* Eliminate limitations on file size and total number of urls (or expand the limits to accommodate larger files and more urls)
* Accept path arguments ($<path_args>) to choose different url list files
* Preferences option to identify and exclude url types (IE. "mailto:")
* Menu command for pre-indexing text files
* Deal properly with blank lines in the url list text file and define a means of commenting lines
* WebSTAR server ACTION Support
* PowerPC native
* Recognize when the text file has been modified more recently than the index and automatically update it.
* Error reporting
* Transaction log
About the Author
I, Grant Neufeld, as of this writing, am an applications programmer for InfoDesign Corporation. My current project there is the Macintosh part of a workflow management system (WorkSMART™). The company also does some good SGML training. They can be contacted at info@idc.com. Please note that they have absolutely nothing to do with this project and are in no way associated with it or responsible for any aspect of it.
I also try (in vain) to maintain the MacHTTP & WebSTAR FAQ:
http://arpp.carleton.ca/machttp/doc/
See my vanity page for more insight into who I am and what I do:
http://arpp.carleton.ca/grant/
Contacting me:
gneufeld@ccs.carleton.ca (At least until May 1996)
grant@acm.org
aa917@freenet.carleton.ca
____________________
Macintosh and Mac are trademarks or registered trademarks of Apple Computer, Inc.
StarNine and WebSTAR are trademarks of StarNine Technologies, Inc.
UNIX is a registered trademark of Novell, Inc.
WorkSMART is a trademark of InfoDesign Corporation.